#include "marche.h"

Marche::Marche(Joueur *A)
{
    this->setJoueur(A);
}

void Marche::setFer()
{
    int i, c=0;
    for(i=0;i<this->v.size();i++){
        if(this->v.value(i)->getType()==1){
            c++;
        }
    }
    this->fer_+=2*c;
    this->data_->setDonnees(this->gold_, this->fer_, this->gardes_, this->score_);
}

void Marche::setGold(int b)
{
    int c=0;
    if(b==0){
        for(int i=0;i<this->v.size();i++){
            if(this->v.value(i)->getType()==0){
                c++;
            }
        }
        this->gold_+=2*c;
    }
    else{
        this->gold_=this->gold_+b;
    }
    this->data_->setDonnees(this->gold_, this->fer_, this->gardes_, this->score_);
}

void Marche::classAbstraite()
{

}
